import qs from "qs";
import {RequestServerClass} from "@/util/request";

export class ZhtsService {
    public rSerivce: any;

    constructor(opt: any, axiosFilterFn?: any) {
        this.rSerivce = new RequestServerClass(opt);
    }

    public getDistrictData(opts?: any) {
        const url = "/ncov/common/runtime_patient_area";
        return this.rSerivce.serverObj.get(url + "?" + qs.stringify(opts));
    }

    // 获取各地区疫情详情(全国)
    public getEpidemicSituationInfo(opts?: any) {
        const url = "/beijing/ncov/pub/sens/findAreaCount";
        return this.rSerivce.serverObj.get(url);
    }

    // 获取各地区疫情详情(各地区)
    public getEpidemicSituationLocalInfo(opts?: any) {
        const url = "/ncov/common/runtime_patient_area_list";
        return this.rSerivce.serverObj.get(url + "?" + qs.stringify(opts));
    }

    // 获取人员迁徙图数据
    public getPersonAllocationComponent(opts?: any) {
        const url = "/beijing/ncov/pub/sens/findMigratePeople";
        return this.rSerivce.serverObj.get(url + "?" + qs.stringify(opts));
    }

    // 获取全国疫情趋势图数据
    public getConfig(url: string, opts?: any) {
        return this.rSerivce.serverObj.get(url + '?' + qs.stringify(opts));
    }

    public getCrowdedPlace(opts?: any) {
        const url = 'http://106.37.227.25:57002/scaffold/group/defense/counts';
        return this.rSerivce.serverObj.get(url + '?' + qs.stringify(opts));
    }

    // 获取迁入迁出趋势图数据
    public getChartData(url: string, opts?: any) {
        return this.rSerivce.serverObj.post(url, opts);
    }
}
